package com.test.serviceImpl;

import com.test.bean.ReStudent;
import com.test.bean.Student;
import com.test.bean.User;
import com.test.dao.UserDao;
import com.test.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserDao userDao;

    @Override
    public User queryForLogin(User user) {
        return userDao.queryForLogin(user);
    }

    @Override
    public void insertUser(User user) {
        userDao.insertUser(user);
    }

    @Override
    public User queryForReg(String username) { return userDao.queryForReg(username); }

    @Override
    public void changePassword(User user) {
        userDao.changePassword(user);
    }

    @Override
    public void addStudent(Student student){
        userDao.addStudent(student);
    }

    @Override
    public void deleteStudent(Student student) {
        userDao.deleteStudent(student);
    }

    @Override
    public void changeStudent(Student student) {
        userDao.changeStudent(student);
    }

    @Override
    public Student queryStudent(int id) {
        return userDao.queryStudent(id);
    }

    @Override
    public List<Student> queryStudents(Student student) {return userDao.queryStudents(student); }

    @Override
    public void addReStudent(ReStudent restudent){
        userDao.addReStudent(restudent);
    }

    @Override
    public void changeRestudent(ReStudent restudent){
        userDao.changeRestudent(restudent);
    }

    @Override
    public ReStudent queryRestudent(ReStudent restudent) {
        return userDao.queryRestudent(restudent);
    }

    @Override
    public void deleteReStudent(ReStudent restudent) {
        userDao.deleteReStudent(restudent);
    }
}
